﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="test.aspx.cs" Inherits="WebApplication1.test" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>#
    <script type="text/javascript">

        $('#btnSubmit').click(function () {

            $.ajax({
                url: "http://uclwebservicetest.cloudapp.net/Services/users.svc/user",
                global: false,
                type: "POST",
                data: JSON.stringify({ Country: "Cyprus", EmailAddress: "co.marios@gmail.com", FirstName: "Marios", LastName: "Constantinides", Organization: "UCL", Purpose: "Educational", Title: "MR", Userid: "1", Username: "testing", Password: "12345" }),
                async: false,
                dataType: 'jsonp',
                //jsonpCallback: 'alertResponse',
                contentType: "application/json; charset=utf-8",
                beforeSend: function () {
                    console.log("before sending data");
                },
                success: function (res) {
                    console.log(res);
                }
            });
        });

    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <a id="btnSubmit" href="#">Testme</a>
    </div>
    </form>
</body>
</html>
